<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <!--[if lt IE 9]>
    <script type="text/javascript" src="lib/html5shiv.js"></script>
    <script type="text/javascript" src="lib/respond.min.js"></script>
    <![endif]-->
    <link rel="stylesheet" type="text/css" href="css/style.css"/>
    <link rel="stylesheet" type="text/css" href="https://cdn.bootcss.com/font-awesome/4.6.0/css/font-awesome.min.css">
    <link rel="stylesheet" type="text/css" href="css/styless.css"/>
    <link rel="stylesheet" type="text/css" href="static/h-ui/css/H-ui.min.css" />
    <link rel="stylesheet" type="text/css" href="static/h-ui.admin/css/H-ui.admin.css" />
    <link rel="stylesheet" type="text/css" href="lib/Hui-iconfont/1.0.8/iconfont.css" />
    <link rel="stylesheet" type="text/css" href="static/h-ui.admin/skin/default/skin.css" id="skin" />
    <link rel="stylesheet" type="text/css" href="static/h-ui.admin/css/style.css" />

    <link href="http://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
    <link href="http://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">

    <link rel="stylesheet" type="text/css" href="css/demo.css">
    <link rel="stylesheet" href="css/print.css">
    <!--[if IE 6]>
    <script type="text/javascript" src="lib/DD_belatedPNG_0.0.8a-min.js" ></script>
    <script>DD_belatedPNG.fix('*');</script>

    <script type="text/javascript" src="external/jquery-1.8.2.js"></script>
    <script type="text/javascript" src="external/jszip.js"></script>
    <script type="text/javascript" src="external/FileSaver.js"></script>
    <script type="text/javascript" src="scripts/excel-gen.js"></script>
    <script type="text/javascript" src="scripts/demo.page.js"></script>


    <![endif]-->
    <title></title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <link rel="stylesheet" href="../static/css/styless.css">
</head>
<body  >
<table id="item">
    <tr><td>
    <!--表头 begin-->
    <!--这里指定打印主要靠这个注释设置-->
    <!--startprint-->
    <div class="card-body">

    <div class="head">

        <div class="shell">
            <!--表头 begin-->
            <div class="head">
                <div class="headTop"><h4>车位信息</h4></div>
                <div class="headTable">
                    <div class="row">
                        <div class="block">
                            <span>房产</span>
                            <input type="text" th:text="${smbid.cs_housing}" th:value="${smbid.cs_housing}"/>

                        </div>

                        <div class="block">
                            <span>车位编号</span>
                            <input type="text" th:text="${smbid.cS_number}" th:value="${smbid.cS_number}"/>
                        </div>

                    </div>

                    <div class="row">
                        <div class="block">
                            <span>状态</span>
                            <input type="text" th:text="${smbid.cs_state}" th:value="${smbid.cs_state}"/>
                        </div>

                        <div class="block">
                            <span>车位类型</span>
                            <input type="text" th:text="${smbid.cs_cartype}" th:value="${smbid.cs_cartype}"/>
                        </div>
                    </div>
                    <div class="row">
                        <div class="block">
                            <span>管理类型</span>
                            <input type="text" th:text="${smbid.cs_manage}" th:value="${smbid.cs_manage}"/>
                        </div>

                        <div class="block">
                            <span>预售价格</span>
                            <input type="text" th:text="${smbid.cs_sell}" th:value="${smbid.cs_sell}"/>
                        </div>


                    </div>

                    <div class="row">
                        <div class="block">
                            <span>预租价格</span>
                            <input type="text" th:text="${smbid.cs_rent}" th:value="${smbid.cs_rent}"/>
                        </div>

                        <div class="block">
                            <span>位置</span>
                            <input type="text" th:text="${smbid.ca_plilce}" th:value="${smbid.ca_plilce}"/>
                        </div>

                    </div>
                    <div class="row">
                        <div class="block">
                            <span>备注</span>
                            <input type="text" th:text="${smbid.cs_remarks}" th:value="${smbid.cs_remarks}"/>
                        </div>


                    </div>
                </div>
            </div>

        </div>


    <!--表头 end-->


    <div class="shell">
        <!--表头 begin-->
        <div class="head">
            <div class="headTop"><h4>产权人信息</h4></div>
            <div class="headTable">
                <div class="row">
                    <div class="block">
                        <span>使用人</span>
                        <!--  [[${smbid.carcontrac.c_userName}]]-->
                        <input type="text" th:text="${smbid.carcontrac.c_userName}" th:value="${smbid.carcontrac.c_userName}"/>
                    </div>

                    <div class="block">
                        <span>合同编号</span>
                        <input type="text" th:text="${smbid.carcontrac.c_contractid}" th:value="${smbid.carcontrac.c_contractid}"/>
                    </div>

                </div>

                <div class="row">
                    <div class="block">
                        <span>车位编号</span>
                        <input type="text" th:text="${smbid.carcontrac.c_number}" th:value="${smbid.carcontrac.c_number}"/>
                    </div>

                    <div class="block">
                        <span>车牌号</span>
                        <input type="text" th:text="${smbid.carcontrac.c_carNumber}" th:value="${smbid.carcontrac.c_carNumber}"/>
                    </div>

                </div>

                <div class="row">
                    <div class="block">
                        <span>联系电话</span>
                        <input type="text" th:text="${smbid.carcontrac.c_phone}" th:value="${smbid.carcontrac.c_phone}"/>
                    </div>

                    <div class="block">
                        <span>租期开始时间</span>
                        <input type="text" th:text="${smbid.carcontrac.c_date}" th:value="${smbid.carcontrac.c_date}"/>
                    </div>




                </div>
                <div class="row">
                    <div class="block">
                        <span>到期时间</span>
                        <input type="text" th:text="${smbid.carcontrac.c_endDate}" th:value="${smbid.carcontrac.c_endDate}"/>
                    </div>

                    <div class="block">
                        <span>购买价格</span>
                        <input type="text" th:text="${smbid.carcontrac.c_goodcost}" th:value="${smbid.carcontrac.c_goodcost}"/>
                    </div>



                </div>
                <div class="row">
                    <div class="block">
                        <span>合同类型</span>
                        <input type="text" th:text="${smbid.carcontrac.c_type}" th:value="${smbid.carcontrac.c_type}"/>
                    </div>

                    <div class="block">
                        <span>签订日期</span>
                        <input type="text" th:text="${smbid.carcontrac.c_signdate}" th:value="${smbid.carcontrac.c_signdate}"/>
                    </div>

                </div>
            </div>
        </div>

    </div>




    </div>
    </div>
    <!--endprint-->
    </div>
    </td></tr>
</table>
    <div class="buttonShell">
        <div class="button">
            <button class="testButton" onClick="doPrint()">打印</button>
            <button type="button" onclick="tableToExcel('item','合同')" class="testButton">导出为Excel</button>

        </div>

    </div>
    <script language="javascript">
        /*
        Author:bruceZhao 2014-06-18
        */
        window.onload = function(){
            //只需修改此处即可
            var className = "editable";
            var array = [];
            var selects = document.getElementsByTagName("select");
            //找到符合条件的select 和 text 对
            for(var i = 0; i<selects.length; i++){
                if(selects[i].getAttribute("class") == className){
                    //找到对应的text文本框
                    var text = selects[i].parentNode.lastElementChild;
                    var sel  = selects[i];
                    var arr = [];
                    arr[0] = sel;
                    arr[1] = text;
                    array.push(arr);
                }
            }

            for(var i=0; i<array.length;i++){
                //遍历符合条件的select 和 text 并添加事件响应函数
                var sel  = array[i][0];
                var text = array[i][1];
                sel.textObj = array[i][1];
                text.selObj = array[i][0];

                sel.onchange = function(){
                    this.textObj.value = this.options[this.selectedIndex].text;
                }
                text.onchange = function(){
                    //去除text框开头结尾的空格
                    this.value = this.value.replace(/^\s*/g,"");
                    this.value = this.value.replace(/\s*$/g,"");
                    //如果text文本框内容发生改变 且select内部没有此text的选项 则加入到select的option选项中
                    for(var j=0;j<this.selObj.options.length;j++){
                        if(this.selObj.options[j].text == this.value){
                            return;
                        }
                    }
                    var opt = new Option();
                    opt.value = this.value;
                    opt.text = this.value;
                    this.selObj.options.add(opt);
                }
            }

        }
    </script>
    <script src="js/jquery.min.js"></script>
    <script src="js/drag-arrange.js"></script>












        <script type="text/javascript">
            //hh
            function base64 (content) {
                return window.btoa(unescape(encodeURIComponent(content)));
            }
            /*
            *@tableId: table的Id
            *@fileName: 要生成excel文件的名字（不包括后缀，可随意填写）
            */
            function tableToExcel(tableID,fileName){
                var table = document.getElementById(tableID);
                var excelContent = table.innerHTML;
                var excelFile = "<html xmlns:o='urn:schemas-microsoft-com:office:office' xmlns:x='urn:schemas-microsoft-com:office:excel' xmlns='http://www.w3.org/TR/REC-html40'>";
                excelFile += "<head><!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>{worksheet}</x:Name><x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]--></head>";
                excelFile += "<body><table>";
                excelFile += excelContent;
                excelFile += "</table></body>";
                excelFile += "</html>";
                var link = "data:application/vnd.ms-excel;base64," + base64(excelFile);
                var a = document.createElement("a");
                a.download = fileName+".xls";
                a.href = link;
                a.click();
            }
        </script>

<script type="text/javascript">
    //打印
function doPrint() {
bdhtml = window.document.body.innerHTML;
sprnstr = "<!--startprint-->"; //开始打印标识字符串有17个字符
eprnstr = "<!--endprint-->"; //结束打印标识字符串
prnhtml = bdhtml.substr(bdhtml.indexOf(sprnstr) + 17); //从开始打印标识之后的内容
prnhtml = prnhtml.substring(0, prnhtml.indexOf(eprnstr)); //截取开始标识和结束标识之间的内容
window.document.body.innerHTML = prnhtml; //把需要打印的指定内容赋给body.innerHTML
window.print(); //调用浏览器的打印功能打印指定区域
window.document.body.innerHTML = bdhtml; // 最后还原页面
}
</script>


</body>
</html>